/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2023-11-14
 * Time: 14:27
 */
public class test2 {
    public static void main(String[] args) {
        //1.定义数组
        int[] arr = {22,24,53,342,46346,34363};
        //调用方法
        int Max = getMax(arr);
        System.out.println("最大值是:"+Max);

    }

    public static int getMax(int[] arr){
        int max = arr[0];

        for (int i = 1;i < arr.length;i++){
            if(arr[i] > max){
                max = arr[i];
            }
        }
        return max;
    }
}
